import {
  getBuildConfig,
  cjsCompatPlugin,
  lcSecretsPlugin,
  importMapPlugin,
  importConstantsPlugin,
} from "@langchain/build";

export default getBuildConfig({
  entry: [
    "./src/index.ts",
    "./src/agents.ts",
    "./src/caches/index.ts",
    "./src/callbacks/base.ts",
    "./src/callbacks/dispatch/index.ts",
    "./src/callbacks/dispatch/web.ts",
    "./src/callbacks/manager.ts",
    "./src/callbacks/promises.ts",
    "./src/chat_history.ts",
    "./src/context.ts",
    "./src/documents/index.ts",
    "./src/document_loaders/base.ts",
    "./src/document_loaders/langsmith.ts",
    "./src/embeddings.ts",
    "./src/example_selectors/index.ts",
    "./src/indexing/index.ts",
    "./src/language_models/base.ts",
    "./src/language_models/chat_models.ts",
    "./src/language_models/llms.ts",
    "./src/language_models/profile.ts",
    "./src/load/index.ts",
    "./src/load/serializable.ts",
    "./src/memory.ts",
    "./src/messages/index.ts",
    "./src/messages/tool.ts",
    "./src/output_parsers/index.ts",
    "./src/output_parsers/openai_tools/index.ts",
    "./src/output_parsers/openai_functions/index.ts",
    "./src/outputs.ts",
    "./src/prompts/index.ts",
    "./src/prompt_values.ts",
    "./src/runnables/index.ts",
    "./src/runnables/graph.ts",
    "./src/retrievers/index.ts",
    "./src/retrievers/document_compressors/index.ts",
    "./src/singletons/index.ts",
    "./src/stores.ts",
    "./src/structured_query/index.ts",
    "./src/tools/index.ts",
    "./src/tracers/base.ts",
    "./src/tracers/console.ts",
    "./src/tracers/log_stream.ts",
    "./src/tracers/run_collector.ts",
    "./src/tracers/tracer_langchain.ts",
    "./src/types/stream.ts",
    "./src/utils/async_caller.ts",
    "./src/utils/chunk_array.ts",
    "./src/utils/env.ts",
    "./src/utils/event_source_parse.ts",
    "./src/utils/format.ts",
    "./src/utils/function_calling.ts",
    "./src/utils/hash.ts",
    "./src/utils/json_patch.ts",
    "./src/utils/json_schema.ts",
    "./src/utils/math.ts",
    "./src/utils/stream.ts",
    "./src/utils/testing/index.ts",
    "./src/utils/tiktoken.ts",
    "./src/utils/types/index.ts",
    "./src/vectorstores.ts",
  ],
  plugins: [
    cjsCompatPlugin({
      files: ["dist/", "CHANGELOG.md", "README.md", "LICENSE"],
    }),
    lcSecretsPlugin(),
    importMapPlugin({
      omitFromImportMap: [
        "load/index",
        "context",
        "callbacks/dispatch/web",
        "callbacks/dispatch/index",
      ],
    }),
    importConstantsPlugin(),
  ],
});
